﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Rotempco.BaseClass.Objects.EntityObjects;
using Rotempco.BaseClass.Objects.Enums;

namespace Rotempco.Website.Objects
{
    public class SessionStore
    {
        #region [ Singleton Constructor ]

        static readonly SessionStore _Instance = new SessionStore();

        static SessionStore()
        {
        }

        private SessionStore()
        {
        }

        public static SessionStore Instance
        {
            get
            {
                if (HttpContext.Current.Session["SessionStore"] == null)
                    HttpContext.Current.Session["SessionStore"] = new SessionStore();

                return HttpContext.Current.Session["SessionStore"] as SessionStore;
            }
        }

        #endregion

        public LoginUser LoginUser { get; set; }
        public string PrivateEncryptionKey { get; set; }
        public bool DebugText { get; set; }
        public object SingletonCacheObject { get; set; }

        internal void Clear()
        {
            HttpContext.Current.Session["SessionStore"] = null;
        }        
    }
}
